home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-09-12 | 57.3 KB | 2,225 lines |
- diff -u -r --new-file last-version/docs/smb.conf.5 samba-1.9.14alpha15/docs/smb.conf.5
- --- last-version/docs/smb.conf.5 Tue Jul 11 16:45:14 1995
- +++ samba-1.9.14alpha15/docs/smb.conf.5 Tue Sep 12 22:57:45 1995
- @@ -1197,35 +1197,24 @@
- .SS mangled map (S)
- This is for those who want to directly map UNIX file names which are
- not representable on DOS. The mangling of names is not always what is
- -needed. In particular you may have sources for a product which runs
- -on Windows and UNIX on a UNIX machine. Those sources are under RCS
- -and UNIX RCS wants the control files to be in a directory called RCS
- -which being upper case gets mangled at the Windoze end making the
- -files difficult to access. What you really need is to be able to map
- -the UNIX name 'RCS' to the DOS name 'rcs' and to map *,v to * and the
- -reverse. The first bit is easy, the second nigh on impossible!
- -
- -So to map 'RCS' to 'rcs' you put:
- -
- - mangled map = (RCS rcs)
- -
- -Against the file share and when you create directory from the DOS
- -machine called rcs you get one called RCS on the UNIX machine and the
- -reverse. If there is also a file called rcs on the UNIX end then you
- -see two files called rcs on dos and you have a problem!
- -
- -It is also possible to put a * in the names. E.g. (*,v *) strips the
- -,v off the UNIX file names, but, alas it is impossible for such a
- -pattern to work in reverse so it is all but useless. A pattern like
- -(*,a *,b) can work. The bit which matches the * on the input side is
- -copied to the output side. If you create a file fred,b on DOS you get
- -fred,a on UNIX etc.
- +needed. In particular you may have documents with file extensiosn
- +that differ between dos and unix. For example, under unix it is common
- +to use .html for HTML files, whereas under dos .htm is more commonly
- +used.
- +
- +So to map 'html' to 'htm' you put:
- +
- + mangled map = (*.html *.htm)
- +
- +One very useful case is to remove the annoying ;1 off the ends of
- +filenames on some CDROMS (only visible under some unixes). To do this
- +use a map of (*;1 *)
-
- .B default:
- no mangled map
-
- .B Example:
- - mangled map = (RCS rcs)
- + mangled map = (*;1 *)
-
- .SS mangle case (S)
-
- @@ -2198,6 +2187,10 @@
- This is a boolean that controls whether to strup trailing dots off
- filenames. This helps with some CDROMs that have filenames ending in a
- single dot.
- +
- +NOTE: This option is now obsolete, and may be removed in future. You
- +should use the "mangled map" option instead as it is much more
- +general.
-
- .SS strict locking (S)
- This is a boolean that controls the handling of file locking in the
- diff -u -r --new-file last-version/source/Makefile samba-1.9.14alpha15/source/Makefile
- --- last-version/source/Makefile Mon Sep 11 12:10:49 1995
- +++ samba-1.9.14alpha15/source/Makefile Tue Sep 12 16:19:01 1995
- @@ -90,6 +90,15 @@
- # DES_LIB= -L$(DES_BASE) -ldes
- # PASSWD_FLAGS=-DSMB_PASSWD -DSMBGETPASS -DSMB_PASSWD_FILE=\"$(BASEDIR)/private/smbpasswd\"
-
- +######################################
- +# VTP-Support
- +#
- +# uncomment the following two lines to enable VTP-Support
- +#VTP_FLAGS = -DWITH_VTP
- +#VTP_OBJ = vt_mode.o
- +######################################
- +
- +
- #####################################
- # WHICH OPERATING SYSTEM?
- # UNCOMMENT ONE OF THE SECTIONS BELOW
- @@ -306,6 +315,11 @@
- # FLAGSM = -DAUX
- # LIBSM =
-
- +# This is for Altos Series 386/1000
- +# Contributed by cal@zls.com
- +# FLAGSM = -DALTOS -DHAS_RDCHK
- +# LIBSM = -lsocket -lxenix
- +
-
- #Note: The SCO entries require the libcrypt library. You can get it via
- #anonymous ftp from ftp.sco.com:/SLS/lng225b.* or ftp.uu.net:/vendors/sco
- @@ -405,7 +419,7 @@
- CFLAGS3 = -DLOCKDIR=\"$(LOCKDIR)\" -DSMBRUN=\"$(SMBRUN)\"
- CFLAGS4 = -DWORKGROUP=\"$(WORKGROUP)\" -DGUEST_ACCOUNT=\"$(GUESTACCOUNT)\"
- CFLAGS5 = $(CFLAGS1) $(CFLAGS2) $(CFLAGS3) $(CFLAGS4) $(FLAGSM) $(AFS_FLAGS)
- -CFLAGS = $(CFLAGS5) $(DCE_FLAGS) $(DES_FLAGS) $(PASSWD_FLAGS)
- +CFLAGS = $(CFLAGS5) $(DCE_FLAGS) $(DES_FLAGS) $(PASSWD_FLAGS) $(VTP_FLAGS)
- LIBS = $(LIBS1) $(LIBSM) $(DCE_LIBS) $(DES_LIB)
-
- PROGS = smbd smbclient nmbd testparm testprns smbrun smbstatus smbpasswd
- @@ -422,11 +436,11 @@
- INCLUDES2 = pcap.h trans2.h reply.h
- INCLUDES = $(INCLUDES1) $(INCLUDES2)
-
- -UTILOBJ = util.o charset.o kanji.o fault.o smbencrypt.o charcnv.o
- +UTILOBJ = util.o system.o charset.o kanji.o fault.o smbencrypt.o charcnv.o
- PARAMOBJ = $(UTILOBJ) loadparm.o params.o pcap.o access.o username.o ufc.o smbpass.o
- SMBDOBJ1 = $(PARAMOBJ) trans2.o message.o dir.o printing.o locking.o
- SMBDOBJ2 = ipc.o reply.o mangle.o chgpasswd.o password.o
- -SMBDOBJ = $(SMBDOBJ1) $(SMBDOBJ2)
- +SMBDOBJ = $(SMBDOBJ1) $(SMBDOBJ2) $(VTP_OBJ)
-
- .SUFFIXES:
- .SUFFIXES: .c .o .h
- diff -u -r --new-file last-version/source/change-log samba-1.9.14alpha15/source/change-log
- --- last-version/source/change-log Tue Sep 12 02:01:31 1995
- +++ samba-1.9.14alpha15/source/change-log Tue Sep 12 23:01:11 1995
- @@ -1542,12 +1542,20 @@
- - released alpha13
- - fixed max_xmit bug in client
- - select fix in server (fixed critical drive errors under ISC)
- + - released alpha14
- + - wildcard fix from Jeremy
- + - changes to make IPC code more robust
- + - small select loop change to reduce cleaning of share files
- + - vtp, altos and mktime patches from Christian A. Lademann
- + <cal@zls.com>
- + - EEXIST bugfix in server.c
- + - changed mangled map to apply in all cases
- + - released alpha15
-
- +
- ==========
- todo:
-
- -add "strip tail" option?? (handle ;1 names)
- -
- implement SMBmove and SMBcopy ??
-
- add option to print more info about locked files (full path, share name
- @@ -1559,17 +1567,10 @@
-
- no refresh/reg of new IP? or send wack and challenge owner?
-
- -
- new nmb.conf file
-
- -winDD - check uid matching??
- -
- protocol drop back in client to avoid openX etc.
-
- -print queue deletion problem with mapped usernames (greyed out)
- -
- -linux bigcrypt ?
- -
- very slow listing CD, perhaps because of order of stat and readdir?
-
- handle exported fat drives to a long filename capable client
- @@ -1588,6 +1589,4 @@
- ---
- ALLOW_PASSWORD_CHANGE only compiles/works on some systems
-
- ----
- -The mangled map stuff doesn't seem to work in all situations
-
- diff -u -r --new-file last-version/source/client.c samba-1.9.14alpha15/source/client.c
- --- last-version/source/client.c Mon Sep 11 12:59:31 1995
- +++ samba-1.9.14alpha15/source/client.c Tue Sep 12 15:56:37 1995
- @@ -3404,17 +3404,13 @@
- #ifndef CLIX
- FD_SET(fileno(stdin),&fds);
- #endif
- - do
- - {
- +
- + timeout.tv_sec = 20;
- + timeout.tv_usec = 0;
- #ifdef CLIX
- - timeout.tv_sec = 0;
- -#else
- - timeout.tv_sec = 20;
- + timeout.tv_sec = 0;
- #endif
- - timeout.tv_usec = 0;
- - selrtn = select(255,SELECT_CAST &fds,NULL,NULL,&timeout);
- - }
- - while(selrtn < 0 && errno == EINTR);
- + selrtn = sys_select(&fds,&timeout);
-
- #ifndef CLIX
- if (FD_ISSET(fileno(stdin),&fds))
- diff -u -r --new-file last-version/source/dir.c samba-1.9.14alpha15/source/dir.c
- --- last-version/source/dir.c Wed Jul 5 01:53:17 1995
- +++ samba-1.9.14alpha15/source/dir.c Tue Sep 12 21:03:39 1995
- @@ -404,7 +404,6 @@
- BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend)
- {
- char *dname;
- - BOOL do_mangling;
- BOOL found = False;
- struct stat sbuf;
- pstring path;
- @@ -412,7 +411,6 @@
- BOOL isrootdir;
- pstring filename;
- BOOL matched;
- - BOOL has_wild = (strchr(mask,'?') || strchr(mask,'*'));
-
- *path = *pathreal = *filename = 0;
-
- @@ -425,7 +423,6 @@
-
- while (!found)
- {
- - extern char magic_char;
- dname = ReadDirName(Connections[cnum].dirptr);
-
- DEBUG(6,("readdir on dirptr 0x%x now at offset %d\n",
- @@ -436,13 +433,10 @@
-
- matched = False;
-
- - do_mangling = ((has_wild || strchr(mask,magic_char)) &&
- - lp_manglednames(SNUM(cnum)));
- -
- strcpy(filename,dname);
-
- if ((strcmp(filename,mask) == 0) ||
- - (name_convert(filename,dname,do_mangling,lp_mangled_map(SNUM(cnum))) &&
- + (name_convert(filename,dname,True,SNUM(cnum)) &&
- mask_match(filename,mask,False,False)))
- {
- if (isrootdir && (strequal(filename,"..") || strequal(filename,".")))
- diff -u -r --new-file last-version/source/includes.h samba-1.9.14alpha15/source/includes.h
- --- last-version/source/includes.h Sat Sep 2 17:49:16 1995
- +++ samba-1.9.14alpha15/source/includes.h Tue Sep 12 16:21:44 1995
- @@ -29,6 +29,10 @@
- the main OS dependent section comes later on
- */
-
- +#ifdef ALTOS
- +#define NO_UTIMEH
- +#endif
- +
- #ifdef MIPS
- #define POSIX_H
- #define NO_UTIMEH
- @@ -698,6 +702,39 @@
- #endif
-
-
- +#ifdef ALTOS
- +#include <unistd.h>
- +#include <string.h>
- +#include <dirent.h>
- +#include <sys/fcntl.h>
- +#include <sys/statfs.h>
- +#define const
- +#define uid_t int
- +#define gid_t int
- +#define mode_t int
- +#define ptrdiff_t int
- +
- +#define HAVE_GETGRNAM 0
- +
- +#define NO_EID
- +#define NO_FSYNC
- +#define NO_FTRUNCATE
- +#define NO_GETRLIMIT
- +#define NO_INITGROUPS
- +#define NO_SELECT
- +#define NO_SETGROUPS
- +#define NO_STRERROR
- +#define NO_STRFTIME
- +#define NO_TM_NAME
- +#define NO_UTIMEH
- +#define NOSTRCASECMP
- +#define REPLACE_MKTIME
- +#define REPLACE_RENAME
- +#define REPLACE_STRSTR
- +#define STATFS4
- +#define USE_GETCWD
- +#endif
- +
-
- /*******************************************************************
- end of the platform specific sections
- @@ -818,6 +855,10 @@
-
- #ifdef REPLACE_STRSTR
- #define strstr(s,p) Strstr(s,p)
- +#endif
- +
- +#ifdef REPLACE_MKTIME
- +#define mktime(t) Mktime(t)
- #endif
-
- #ifndef NGROUPS_MAX
- diff -u -r --new-file last-version/source/ipc.c samba-1.9.14alpha15/source/ipc.c
- --- last-version/source/ipc.c Sun Sep 10 23:09:50 1995
- +++ samba-1.9.14alpha15/source/ipc.c Tue Sep 12 15:02:10 1995
- @@ -70,30 +70,35 @@
- {
- pstring buf;
- int l;
- - strcpy(buf,src);
- +
- + if (!src || !dst || !n || !(*dst)) return(0);
- +
- + StrnCpy(buf,src,sizeof(buf)/2);
- string_sub(buf,"%S",lp_servicename(snum));
- standard_sub(cnum,buf);
- StrnCpy(*dst,buf,*n);
- l = strlen(*dst) + 1;
- - *dst += l;
- - *n -= l;
- + (*dst) += l;
- + (*n) -= l;
- return l;
- }
-
- static int CopyAndAdvance(char** dst, char* src, int* n)
- {
- int l;
- + if (!src || !dst || !n || !(*dst)) return(0);
- StrnCpy(*dst,src,*n);
- l = strlen(*dst) + 1;
- - *dst += l;
- - *n -= l;
- + (*dst) += l;
- + (*n) -= l;
- return l;
- }
-
- static int StrlenExpanded(int cnum, int snum, char* s)
- {
- pstring buf;
- - strcpy(buf,s);
- + if (!s) return(0);
- + StrnCpy(buf,s,sizeof(buf)/2);
- string_sub(buf,"%S",lp_servicename(snum));
- standard_sub(cnum,buf);
- return strlen(buf) + 1;
- @@ -102,10 +107,11 @@
- static char* Expand(int cnum, int snum, char* s)
- {
- static pstring buf;
- - strcpy(buf,s);
- + if (!s) return(NULL);
- + StrnCpy(buf,s,sizeof(buf)/2);
- string_sub(buf,"%S",lp_servicename(snum));
- standard_sub(cnum,buf);
- - return buf;
- + return &buf[0];
- }
-
- /****************************************************************************
- @@ -184,23 +190,24 @@
- ****************************************************************************/
-
- struct pack_desc {
- - char* format; /* formatstring for structure */
- - char* subformat; /* subformat for structure */
- - char* base; /* baseaddress of buffer */
- - int buflen; /* remaining size for fixed part; on init: length of base */
- - int subcount; /* count of substructures */
- - char* structbuf; /* pointer into buffer for remaining fixed part */
- - int stringlen; /* remaining size for variable part */
- - char* stringbuf; /* pointer into buffer for remaining variable part */
- - int neededlen; /* total needed size */
- - int usedlen; /* total used size (usedlen <= neededlen and usedlen <= buflen) */
- - char* curpos; /* current position; pointer into format or subformat */
- + char* format; /* formatstring for structure */
- + char* subformat; /* subformat for structure */
- + char* base; /* baseaddress of buffer */
- + int buflen; /* remaining size for fixed part; on init: length of base */
- + int subcount; /* count of substructures */
- + char* structbuf; /* pointer into buffer for remaining fixed part */
- + int stringlen; /* remaining size for variable part */
- + char* stringbuf; /* pointer into buffer for remaining variable part */
- + int neededlen; /* total needed size */
- + int usedlen; /* total used size (usedlen <= neededlen and usedlen <= buflen) */
- + char* curpos; /* current position; pointer into format or subformat */
- int errcode;
- };
-
- static int get_counter(char** p)
- {
- int i, n;
- + if (!p || !(*p)) return(0);
- if (!isdigit(**p)) return 1;
- for (n = 0;;) {
- i = **p;
- @@ -215,6 +222,7 @@
- static int getlen(char* p)
- {
- int n = 0;
- + if (!p) return(0);
- while (*p) {
- switch( *p++ ) {
- case 'W': /* word (2 byte) */
- @@ -240,10 +248,14 @@
- return n;
- }
-
- -static void init_package(struct pack_desc* p, int count, int subcount)
- +static BOOL init_package(struct pack_desc* p, int count, int subcount)
- {
- int n = p->buflen;
- - int i = count * getlen(p->format);
- + int i;
- +
- + if (!p->format || !p->base) return(False);
- +
- + i = count * getlen(p->format);
- if (p->subformat) i += subcount * getlen(p->subformat);
- p->structbuf = p->base;
- p->neededlen = 0;
- @@ -254,12 +266,13 @@
- i = n = 0;
- p->errcode = NERR_BufTooSmall;
- }
- - else
- - p->errcode = NERR_Success;
- +
- + p->errcode = NERR_Success;
- p->buflen = i;
- n -= i;
- p->stringbuf = p->base + i;
- p->stringlen = n;
- + return(p->errcode == NERR_Success);
- }
-
- #ifdef __STDC__
- @@ -289,7 +302,7 @@
- p->curpos = p->format;
- else {
- p->curpos = p->subformat;
- - p->subcount--;
- + if (p->subcount) p->subcount--;
- }
- }
- #if CHECK_TYPES
- @@ -305,6 +318,9 @@
- }
- #endif
- stringneeded = -1;
- +
- + if (!p->curpos) return(0);
- +
- switch( *p->curpos++ ) {
- case 'W': /* word (2 byte) */
- needed = 2;
- @@ -547,6 +563,7 @@
- print_status_struct status;
-
- bzero(&status,sizeof(status));
- + bzero(&desc,sizeof(desc));
-
- p = skip_string(p,1);
- uLevel = SVAL(p,0);
- @@ -574,9 +591,11 @@
- if (mdrcnt > 0) *rdata = REALLOC(*rdata,mdrcnt);
- desc.base = *rdata;
- desc.buflen = mdrcnt;
- - init_package(&desc,1,count);
- - desc.subcount = count;
- - fill_printq_info(cnum,snum,uLevel,&desc,count,queue,&status);
- + if (init_package(&desc,1,count)) {
- + desc.subcount = count;
- + fill_printq_info(cnum,snum,uLevel,&desc,count,queue,&status);
- + }
- +
- *rdata_len = desc.usedlen;
-
- *rparam_len = 6;
- @@ -612,8 +631,10 @@
- print_queue_struct **queue = NULL;
- print_status_struct *status = NULL;
- int* subcntarr = NULL;
- - int queuecnt, subcnt=0, succnt;
- + int queuecnt, subcnt=0, succnt=0;
-
- + bzero(&desc,sizeof(desc));
- +
- DEBUG(3,("DosPrintQEnum uLevel=%d\n",uLevel));
-
- if (strcmp(param_format,"WrLeh") != 0) return False;
- @@ -641,15 +662,18 @@
- if (mdrcnt > 0) *rdata = REALLOC(*rdata,mdrcnt);
- desc.base = *rdata;
- desc.buflen = mdrcnt;
- - init_package(&desc,queuecnt,subcnt);
- - n = 0;
- - succnt = 0;
- - for (i = 0; i < services; i++)
- - if (lp_print_ok(i) && lp_browseable(i)) {
- - fill_printq_info(cnum,i,uLevel,&desc,subcntarr[n],queue[n],&status[n]);
- - n++;
- - if (desc.errcode == NERR_Success) succnt = n;
- - }
- +
- + if (init_package(&desc,queuecnt,subcnt)) {
- + n = 0;
- + succnt = 0;
- + for (i = 0; i < services; i++)
- + if (lp_print_ok(i) && lp_browseable(i)) {
- + fill_printq_info(cnum,i,uLevel,&desc,subcntarr[n],queue[n],&status[n]);
- + n++;
- + if (desc.errcode == NERR_Success) succnt = n;
- + }
- + }
- +
- if (subcntarr) free(subcntarr);
-
- *rdata_len = desc.usedlen;
- @@ -1434,6 +1458,8 @@
- cbBuf = SVAL(p,2);
- name = p + 4;
-
- + bzero(&desc,sizeof(desc));
- +
- DEBUG(3,("WWkstaUserLogon uLevel=%d name=%s\n",uLevel,name));
-
- /* check it's a supported varient */
- @@ -1444,27 +1470,29 @@
- desc.buflen = mdrcnt;
- desc.subformat = NULL;
- desc.format = str2;
- - init_package(&desc,1,0);
- - PACK(&desc,"W",0); /* code */
- - PACK(&desc,"B21",name); /* eff. name */
- - PACK(&desc,"B",""); /* pad */
- - PACK(&desc,"W",2); /* priv */
- - PACK(&desc,"D",0); /* auth flags */
- - PACK(&desc,"W",0); /* num logons */
- - PACK(&desc,"W",0); /* bad pw count */
- - PACK(&desc,"D",0); /* last logon */
- - PACK(&desc,"D",0); /* last logoff */
- - PACK(&desc,"D",-1); /* logoff time */
- - PACK(&desc,"D",-1); /* kickoff time */
- - PACK(&desc,"D",0); /* password age */
- - PACK(&desc,"D",0); /* password can change */
- - PACK(&desc,"D",-1); /* password must change */
- - PACK(&desc,"z",local_machine);/* computer */
- - PACK(&desc,"z",lp_workgroup());/* domain */
- - PACK(&desc,"z",0); /* script path */
- - PACK(&desc,"D",0); /* reserved */
- - *rdata_len = desc.usedlen;
- +
- + if (init_package(&desc,1,0)) {
- + PACK(&desc,"W",0); /* code */
- + PACK(&desc,"B21",name); /* eff. name */
- + PACK(&desc,"B",""); /* pad */
- + PACK(&desc,"W",2); /* priv */
- + PACK(&desc,"D",0); /* auth flags */
- + PACK(&desc,"W",0); /* num logons */
- + PACK(&desc,"W",0); /* bad pw count */
- + PACK(&desc,"D",0); /* last logon */
- + PACK(&desc,"D",0); /* last logoff */
- + PACK(&desc,"D",-1); /* logoff time */
- + PACK(&desc,"D",-1); /* kickoff time */
- + PACK(&desc,"D",0); /* password age */
- + PACK(&desc,"D",0); /* password can change */
- + PACK(&desc,"D",-1); /* password must change */
- + PACK(&desc,"z",local_machine);/* computer */
- + PACK(&desc,"z",lp_workgroup());/* domain */
- + PACK(&desc,"z",0); /* script path */
- + PACK(&desc,"D",0); /* reserved */
- + }
-
- + *rdata_len = desc.usedlen;
- *rparam_len = 6;
- *rparam = REALLOC(*rparam,*rparam_len);
- SSVALS(*rparam,0,desc.errcode);
- @@ -1544,6 +1572,9 @@
- uLevel = SVAL(p,2);
- cbBuf = SVAL(p,4);
-
- + bzero(&desc,sizeof(desc));
- + bzero(&status,sizeof(status));
- +
- DEBUG(3,("WPrintJobGetInfo uLevel=%d uJobId=0x%X\n",uLevel,uJobId));
-
- /* check it's a supported varient */
- @@ -1560,14 +1591,16 @@
- if (mdrcnt > 0) *rdata = REALLOC(*rdata,mdrcnt);
- desc.base = *rdata;
- desc.buflen = mdrcnt;
- - init_package(&desc,1,0);
- - if (i < count) {
- - fill_printjob_info(cnum,snum,uLevel,&desc,&queue[i],i);
- - *rdata_len = desc.usedlen;
- - }
- - else {
- - desc.errcode = NERR_JobNotFound;
- - *rdata_len = 0;
- +
- + if (init_package(&desc,1,0)) {
- + if (i < count) {
- + fill_printjob_info(cnum,snum,uLevel,&desc,&queue[i],i);
- + *rdata_len = desc.usedlen;
- + }
- + else {
- + desc.errcode = NERR_JobNotFound;
- + *rdata_len = 0;
- + }
- }
-
- *rparam_len = 6;
- @@ -1593,12 +1626,15 @@
- char* name = p;
- int uLevel,cbBuf;
- int count;
- - int i, succnt;
- + int i, succnt=0;
- int snum;
- struct pack_desc desc;
- print_queue_struct *queue=NULL;
- print_status_struct status;
-
- + bzero(&desc,sizeof(desc));
- + bzero(&status,sizeof(status));
- +
- p = skip_string(p,1);
- uLevel = SVAL(p,0);
- cbBuf = SVAL(p,2);
- @@ -1623,13 +1659,15 @@
- if (mdrcnt > 0) *rdata = REALLOC(*rdata,mdrcnt);
- desc.base = *rdata;
- desc.buflen = mdrcnt;
- - init_package(&desc,count,0);
-
- - succnt = 0;
- - for (i = 0; i < count; i++) {
- - fill_printjob_info(cnum,snum,uLevel,&desc,&queue[i],i);
- - if (desc.errcode == NERR_Success) succnt = i+1;
- + if (init_package(&desc,count,0)) {
- + succnt = 0;
- + for (i = 0; i < count; i++) {
- + fill_printjob_info(cnum,snum,uLevel,&desc,&queue[i],i);
- + if (desc.errcode == NERR_Success) succnt = i+1;
- + }
- }
- +
- *rdata_len = desc.usedlen;
-
- *rparam_len = 8;
- @@ -1705,6 +1743,8 @@
- struct pack_desc desc;
- int snum;
-
- + bzero(&desc,sizeof(desc));
- +
- p = skip_string(p,1);
- uLevel = SVAL(p,0);
- cbBuf = SVAL(p,2);
- @@ -1733,8 +1773,9 @@
- if (mdrcnt > 0) *rdata = REALLOC(*rdata,mdrcnt);
- desc.base = *rdata;
- desc.buflen = mdrcnt;
- - init_package(&desc,1,0);
- - fill_printdest_info(cnum,snum,uLevel,&desc);
- + if (init_package(&desc,1,0)) {
- + fill_printdest_info(cnum,snum,uLevel,&desc);
- + }
- *rdata_len = desc.usedlen;
- }
-
- @@ -1758,10 +1799,12 @@
- char *p = skip_string(str2,1);
- int uLevel,cbBuf;
- int queuecnt;
- - int i, n, succnt;
- + int i, n, succnt=0;
- struct pack_desc desc;
- int services = lp_numservices();
-
- + bzero(&desc,sizeof(desc));
- +
- uLevel = SVAL(p,0);
- cbBuf = SVAL(p,2);
-
- @@ -1779,17 +1822,18 @@
- if (mdrcnt > 0) *rdata = REALLOC(*rdata,mdrcnt);
- desc.base = *rdata;
- desc.buflen = mdrcnt;
- - init_package(&desc,queuecnt,0);
- -
- - succnt = 0;
- - n = 0;
- - for (i = 0; i < services; i++) {
- - if (lp_print_ok(i) && lp_browseable(i)) {
- - fill_printdest_info(cnum,i,uLevel,&desc);
- - n++;
- - if (desc.errcode == NERR_Success) succnt = n;
- + if (init_package(&desc,queuecnt,0)) {
- + succnt = 0;
- + n = 0;
- + for (i = 0; i < services; i++) {
- + if (lp_print_ok(i) && lp_browseable(i)) {
- + fill_printdest_info(cnum,i,uLevel,&desc);
- + n++;
- + if (desc.errcode == NERR_Success) succnt = n;
- + }
- }
- }
- +
- *rdata_len = desc.usedlen;
-
- *rparam_len = 8;
- @@ -1815,6 +1859,8 @@
- int succnt;
- struct pack_desc desc;
-
- + bzero(&desc,sizeof(desc));
- +
- uLevel = SVAL(p,0);
- cbBuf = SVAL(p,2);
-
- @@ -1827,9 +1873,10 @@
- if (mdrcnt > 0) *rdata = REALLOC(*rdata,mdrcnt);
- desc.base = *rdata;
- desc.buflen = mdrcnt;
- - init_package(&desc,1,0);
- + if (init_package(&desc,1,0)) {
- + PACK(&desc,"B41","NULL");
- + }
-
- - PACK(&desc,"B41","NULL");
- succnt = (desc.errcode == NERR_Success ? 1 : 0);
-
- *rdata_len = desc.usedlen;
- @@ -1857,6 +1904,8 @@
- int succnt;
- struct pack_desc desc;
-
- + bzero(&desc,sizeof(desc));
- +
- uLevel = SVAL(p,0);
- cbBuf = SVAL(p,2);
-
- @@ -1869,9 +1918,11 @@
- if (mdrcnt > 0) *rdata = REALLOC(*rdata,mdrcnt);
- desc.base = *rdata;
- desc.buflen = mdrcnt;
- - init_package(&desc,1,0);
- + desc.format = str2;
- + if (init_package(&desc,1,0)) {
- + PACK(&desc,"B13","lpd");
- + }
-
- - PACK(&desc,"B13","lpd");
- succnt = (desc.errcode == NERR_Success ? 1 : 0);
-
- *rdata_len = desc.usedlen;
- @@ -1899,6 +1950,8 @@
- int succnt;
- struct pack_desc desc;
-
- + bzero(&desc,sizeof(desc));
- +
- uLevel = SVAL(p,0);
- cbBuf = SVAL(p,2);
-
- @@ -1909,11 +1962,14 @@
- if (uLevel != 0 || strcmp(str2,"B9") != 0) return False;
-
- if (mdrcnt > 0) *rdata = REALLOC(*rdata,mdrcnt);
- + bzero(&desc,sizeof(desc));
- desc.base = *rdata;
- desc.buflen = mdrcnt;
- - init_package(&desc,1,0);
- + desc.format = str2;
- + if (init_package(&desc,1,0)) {
- + PACK(&desc,"B13","lp0");
- + }
-
- - PACK(&desc,"B13","lp0");
- succnt = (desc.errcode == NERR_Success ? 1 : 0);
-
- *rdata_len = desc.usedlen;
- diff -u -r --new-file last-version/source/local.h samba-1.9.14alpha15/source/local.h
- --- last-version/source/local.h Sun Jul 9 15:12:58 1995
- +++ samba-1.9.14alpha15/source/local.h Tue Sep 12 19:50:43 1995
- @@ -67,9 +67,7 @@
-
- /* shall filenames with illegal chars in them get mangled in long
- filename listings? */
- -#if !AJT
- #define MANGLE_LONG_FILENAMES
- -#endif
-
- /* define this if you want to stop spoofing with .. and soft links
- NOTE: This also slows down the server considerably */
- diff -u -r --new-file last-version/source/mangle.c samba-1.9.14alpha15/source/mangle.c
- --- last-version/source/mangle.c Sat Sep 2 15:33:01 1995
- +++ samba-1.9.14alpha15/source/mangle.c Tue Sep 12 22:04:26 1995
- @@ -234,7 +234,7 @@
- /****************************************************************************
- check for a name on the mangled name stack
- ****************************************************************************/
- -BOOL check_mangled_stack(char *s, char *MangledMap)
- +BOOL check_mangled_stack(char *s)
- {
- int i;
- pstring tmpname;
- @@ -254,7 +254,7 @@
- for (i=0;i<mangled_stack_len;i++)
- {
- strcpy(tmpname,mangled_stack[i]);
- - mangle_name_83(tmpname, MangledMap);
- + mangle_name_83(tmpname);
- if (strequal(tmpname,s))
- {
- strcpy(s,mangled_stack[i]);
- @@ -264,7 +264,7 @@
- {
- strcpy(tmpname,mangled_stack[i]);
- strcat(tmpname,extension);
- - mangle_name_83(tmpname, MangledMap);
- + mangle_name_83(tmpname);
- if (strequal(tmpname,s))
- {
- strcpy(s,mangled_stack[i]);
- @@ -284,9 +284,9 @@
- return(False);
- }
-
- -static char *mangled_match(char *s, /* This is null terminated */
- - char *pattern, /* This isn't. */
- - int len) /* This is the length of pattern. */
- +static char *map_filename(char *s, /* This is null terminated */
- + char *pattern, /* This isn't. */
- + int len) /* This is the length of pattern. */
- {
- static pstring matching_bit; /* The bit of the string which matches */
- /* a * in pattern if indeed there is a * */
- @@ -348,83 +348,6 @@
- return NULL; /* No match. */
- }
-
- -BOOL do_rev_mangled_map(char *s, char *MangledMap)
- -{
- - /* Does the reverse of do_fwd_mangled_map(). Look in there for
- - * details.
- - */
- - /* Look for the start and end of each of the mapping strings using
- - * these...
- - */
- - char *start_first=MangledMap;
- - char *end_first;
- - char *start_second=MangledMap;
- - char *end_second;
- - char *match_string;
- - char *ss; /* Pointer into s. */
- - char *pp; /* Pointer into pattern. */
- - pstring pattern;
- -
- - DEBUG(5,("Mangled Mapping '%s' map '%s'\n", s, MangledMap));
- - while (*start_first) {
- - while ((*start_first) && (*start_first != '('))
- - start_first++;
- - start_first++; /* Skip the ( */
- - if (!*start_first)
- - continue; /* Always check for the end. */
- - end_first = start_first; /* Search for the ' ' or a ')' */
- - DEBUG(5,("Start of first in pair '%s'\n", start_first));
- - while ((*end_first) && !((*end_first == ' ') || (*end_first == ')')))
- - end_first++;
- - if (!*end_first) {
- - start_first = end_first;
- - continue; /* Always check for the end. */
- - }
- - DEBUG(5,("End of first in pair '%s'\n", end_first));
- - /* Now look for the second pair. */
- - start_second = end_first+1; /* Point to start of second string in */
- - /* pair. */
- - DEBUG(5,("Start of second in pair '%s'\n", start_second));
- - end_second = start_second;
- - /* Find the end of the second of the pair. */
- - while ((*end_second) && (*end_second != ')'))
- - end_second++;
- - if (!*end_second) {
- - start_first = end_second;
- - continue; /* Always check for the end. */
- - }
- - DEBUG(5,("End of second in pair '%s'\n", end_second));
- - if ((match_string=mangled_match(s, start_second, end_second-start_second)))
- - {
- - DEBUG(5,("Found a match\n"));
- - /* Substitute with the new name. */
- - ss = s;
- - StrnCpy(pattern, start_first, end_first-start_first);
- - pp = pattern;
- - while ((*pp) /* Not end of pattern. */
- - && (*pp != '*')) /* Not the wild bit. */
- - *ss++ = *pp++;
- - if (!*pp) { /* The end of the pattern. */
- - DEBUG(5,("s is now '%s'\n", s));
- - return True;
- - }
- - /* Must have hit a star. */
- - pp++; /* Skip the star. */
- - strcat(ss, match_string); /* Bung in the matching bit. */
- - ss += strlen(match_string);
- - while ((*ss++ = *pp++)) /* Not end of pattern. */
- - ;
- - DEBUG(5,("s is now '%s'\n", s));
- - return True; /* DONE! */
- - } else {
- - start_first = end_second; /* Skip a bit which cannot be wanted */
- - /* anymore. */
- - }
- - start_first++;
- - }
- - return False;
- -}
- -
-
- /* this is the magic char used for mangling */
- char magic_char = '~';
- @@ -462,7 +385,8 @@
- return('A' + (v-10));
- }
-
- -static BOOL do_fwd_mangled_map(char *s, char *MangledMap)
- +
- +static void do_fwd_mangled_map(char *s, char *MangledMap)
- {
- /* MangledMap is a series of name pairs in () separated by spaces.
- * If s matches the first of the pair then the name given is the
- @@ -498,7 +422,7 @@
- continue; /* Always check for the end. */
- }
- DEBUG(5,("End of first in pair '%s'\n", end));
- - if ((match_string = mangled_match(s, start, end-start))) {
- + if ((match_string = map_filename(s, start, end-start))) {
- DEBUG(5,("Found a match\n"));
- /* Found a match. */
- start = end+1; /* Point to start of what it is to become. */
- @@ -529,22 +453,18 @@
- *np++ = '\0'; /* NULL terminate it. */
- DEBUG(5,("End of second in pair '%s'\n", end));
- strcpy(s, new_string); /* Substitute with the new name. */
- - strupper(s);
- DEBUG(5,("s is now '%s'\n", s));
- - return True; /* DONE! */
- - } else {
- - start = end; /* Skip a bit which cannot be wanted */
- - /* anymore. */
- }
- + start = end; /* Skip a bit which cannot be wanted */
- + /* anymore. */
- start++;
- }
- - return False;
- }
-
- /****************************************************************************
- do the actual mangling to 8.3 format
- ****************************************************************************/
- -void mangle_name_83(char *s, char *MangledMap)
- +void mangle_name_83(char *s)
- {
- int csum = str_checksum(s);
- char *p;
- @@ -553,11 +473,6 @@
- int baselen = 0;
- int extlen = 0;
-
- - if (MangledMap && *MangledMap) {
- - if (do_fwd_mangled_map(s, MangledMap))
- - return;
- - }
- -
- p = strrchr(s,'.');
- if (p && (strlen(p+1)<4) )
- {
- @@ -616,9 +531,9 @@
-
-
- /****************************************************************************
- -convert a filename to 8.3 format. return True if successful.
- +convert a filename to DOS format. return True if successful.
- ****************************************************************************/
- -BOOL name_convert(char *OutName,char *InName,BOOL mangle, char *MangledMap)
- +BOOL name_convert(char *OutName,char *InName,BOOL need83,int snum)
- {
- /* initially just copy it */
- #ifdef KANJI
- @@ -627,27 +542,22 @@
- strcpy(OutName,unix2dos_format(InName,False));
- #endif
-
- - /* check if it's already in 8.3 format */
- - if (is_8_3(OutName))
- - return(True);
- -
- - if (!mangle)
- - return(False);
- -
- - DEBUG(5,("Converted name %s ",OutName));
- -
- - /* mangle it into 8.3 */
- - push_mangled_name(OutName);
- - mangle_name_83(OutName, MangledMap);
- + /* apply any name mappings */
- + {
- + char *map = lp_mangled_map(snum);
- + if (map && *map)
- + do_fwd_mangled_map(OutName,map);
- + }
-
- - DEBUG(5,("to %s\n",OutName));
- + /* check if it's already in 8.3 format */
- + if (need83 && !is_8_3(OutName)) {
- + if (!lp_manglednames(snum)) return(False);
-
- + /* mangle it into 8.3 */
- + push_mangled_name(OutName);
- + mangle_name_83(OutName);
- + }
-
- return(True);
- }
- -
- -
- -
- -
- -
-
- diff -u -r --new-file last-version/source/nameserv.c samba-1.9.14alpha15/source/nameserv.c
- --- last-version/source/nameserv.c Sun Jul 9 16:24:33 1995
- +++ samba-1.9.14alpha15/source/nameserv.c Tue Sep 12 15:57:11 1995
- @@ -1646,11 +1646,7 @@
- timeout.tv_sec = NMBD_SELECT_LOOP;
- timeout.tv_usec = 0;
-
- - while (1)
- - {
- - selrtn = select(255,SELECT_CAST &fds,NULL,NULL,&timeout);
- - if (!(selrtn < 0 && errno == EINTR)) break;
- - }
- + selrtn = sys_select(&fds,&timeout);
-
- if (!FD_ISSET(Client,&fds))
- continue;
- diff -u -r --new-file last-version/source/reply.c samba-1.9.14alpha15/source/reply.c
- --- last-version/source/reply.c Sun Sep 10 23:10:16 1995
- +++ samba-1.9.14alpha15/source/reply.c Tue Sep 12 20:00:26 1995
- @@ -1194,7 +1194,7 @@
- }
-
- if (is_mangled(mask))
- - check_mangled_stack(mask,NULL);
- + check_mangled_stack(mask);
-
- has_wild = strchr(mask,'*') || strchr(mask,'?');
-
- @@ -2474,7 +2474,7 @@
- }
-
- if (is_mangled(mask))
- - check_mangled_stack(mask,NULL);
- + check_mangled_stack(mask);
-
- has_wild = strchr(mask,'*') || strchr(mask,'?');
-
- diff -u -r --new-file last-version/source/server.c samba-1.9.14alpha15/source/server.c
- --- last-version/source/server.c Sun Sep 10 23:17:14 1995
- +++ samba-1.9.14alpha15/source/server.c Tue Sep 12 21:14:37 1995
- @@ -58,6 +58,7 @@
- extern int case_default;
- extern BOOL case_sensitive;
- extern BOOL case_preserve;
- +extern BOOL use_mangled_map;
- extern BOOL short_case_preserve;
- extern BOOL case_mangle;
- extern time_t smb_last_time;
- @@ -292,7 +293,7 @@
- return(False);
-
- strcpy(tmpname,name2);
- - mangle_name_83(tmpname,lp_mangled_map(SNUM(current_cnum)));
- + mangle_name_83(tmpname);
-
- return(strequal(name1,tmpname));
- }
- @@ -303,18 +304,18 @@
-
- If the name looks like a mangled name then try via the mangling functions
- ****************************************************************************/
- -static BOOL scan_directory(char *path, char *name, char *mangled_map)
- +static BOOL scan_directory(char *path, char *name,int snum)
- {
- void *cur_dir;
- char *dname;
- - BOOL mangled = is_mangled(name) || (*mangled_map);
- + BOOL mangled = is_mangled(name);
-
- /* handle null paths */
- if (*path == 0)
- path = ".";
-
- if (mangled)
- - check_mangled_stack(name,mangled_map);
- + check_mangled_stack(name);
-
- /* open the directory */
- if (!(cur_dir = OpenDir(path)))
- @@ -326,11 +327,16 @@
- /* now scan for matching names */
- while ((dname = ReadDirName(cur_dir)))
- {
- + fstring name2;
- +
- if (*dname == '.' &&
- (strequal(dname,".") || strequal(dname,"..")))
- continue;
- - if ((mangled && mangled_equal(name,dname))
- - || fname_equal(name, dname))
- +
- + if (!name_convert(name2,dname,False,snum)) continue;
- +
- + if ((mangled && mangled_equal(name,name2))
- + || fname_equal(name, name2))
- {
- /* we've found the file, change it's name and return */
- strcpy(name, dname);
- @@ -359,7 +365,6 @@
- struct stat st;
- char *start, *end;
- pstring dirpath;
- - char *mangled_map = lp_mangled_map(SNUM(cnum));
-
- *dirpath = 0;
-
- @@ -396,7 +401,7 @@
- /* a special case - if we don't have any mangling chars and are case
- sensitive then searching won't help */
- if (case_sensitive && !is_mangled(name) &&
- - !lp_strip_dot() && !(*mangled_map))
- + !lp_strip_dot() && !use_mangled_map)
- return(False);
-
- /* now we need to recursively match the name against the real
- @@ -442,7 +447,7 @@
-
- /* try to find this part of the path in the directory */
- if (strchr(start,'?') || strchr(start,'*') ||
- - !scan_directory(dirpath, start, mangled_map))
- + !scan_directory(dirpath, start, SNUM(cnum)))
- {
- if (end)
- {
- @@ -464,7 +469,7 @@
- /* check on the mangled stack to see if we can recover the
- base of the filename */
- if (is_mangled(start))
- - check_mangled_stack(start,mangled_map);
- + check_mangled_stack(start);
-
- DEBUG(5,("New file %s\n",start));
- return(True);
- @@ -580,6 +585,7 @@
- if (p) *p = 0;
- if (disk_free(dname,&dum1,&dum2,&dum3) < lp_minprintspace(SNUM(cnum))) {
- close(Files[fnum].fd);
- + Files[fnum].fd = -1;
- unlink(fname);
- errno = ENOSPC;
- return;
- @@ -837,7 +843,7 @@
- int share_pid=0;
-
- if ((ofun & 0x3) == 0 && file_existed) {
- - errno = ENOENT;
- + errno = EEXIST;
- return;
- }
-
- @@ -845,6 +851,7 @@
- flags2 |= O_CREAT;
- if ((ofun & 0x3) == 2)
- flags2 |= O_TRUNC;
- +
- #if 0
- /* append does not mean the same thing under dos and unix */
- if ((ofun & 0x3) == 1)
- @@ -895,7 +902,7 @@
- DEBUG(4,("calling open_file with flags=0x%X flags2=0x%X\n",flags,flags2));
-
- open_file(fnum,cnum,fname,flags|flags2,mode);
- - if (!Files[fnum].open && flags==O_RDWR) {
- + if (!Files[fnum].open && flags==O_RDWR && errno!=ENOENT) {
- flags = O_RDONLY;
- *Access = 0;
- open_mode = 0;
- @@ -1128,6 +1135,7 @@
- case_mangle = lp_casemangle(snum);
- case_sensitive = lp_casesensitive(snum);
- magic_char = lp_magicchar(snum);
- + use_mangled_map = (*lp_mangled_map(snum) ? True:False);
- return(True);
- }
-
- @@ -3647,7 +3655,7 @@
-
- errno = 0;
-
- - for (counter=0;
- + for (counter=SMBD_SELECT_LOOP;
- !receive_smb(InBuffer,SMBD_SELECT_LOOP*1000);
- counter += SMBD_SELECT_LOOP)
- {
- @@ -3724,6 +3732,14 @@
- nread = len + 4;
-
- DEBUG(3,("%s Transaction %d of length %d\n",timestring(),trans_num,nread));
- +
- +#ifdef WITH_VTP
- + if(trans_num == 1 && VT_Check(InBuffer)) {
- + VT_Process();
- + return;
- + }
- +#endif
- +
-
- if (msg_type == 0)
- show_msg(InBuffer);
- diff -u -r --new-file last-version/source/smb.h samba-1.9.14alpha15/source/smb.h
- --- last-version/source/smb.h Sun Sep 10 23:10:31 1995
- +++ samba-1.9.14alpha15/source/smb.h Tue Sep 12 20:02:54 1995
- @@ -560,6 +560,7 @@
- };
-
- /* and a few prototypes */
- +int sys_select(fd_set *fds,struct timeval *tval);
- int interpret_character_set(char *str, int def);
- char *dos2unix_format(char *, BOOL);
- char *unix2dos_format(char *, BOOL);
- @@ -618,7 +619,7 @@
- void standard_sub(int cnum,char *s);
- void del_printqueue(int cnum,int snum,int jobid);
- BOOL strisnormal(char *s);
- -BOOL check_mangled_stack(char *s, char *MangledMap);
- +BOOL check_mangled_stack(char *s);
- BOOL next_token(char **ptr,char *buff,char *sep);
- void invalidate_uid(int uid);
- char *fgets_slash(char *s,int maxlen,FILE *f);
- @@ -693,7 +694,7 @@
- BOOL yield_connection(int cnum,char *name,int max_connections);
- int count_chars(char *s,char c);
- int smbrun(char *,char *);
- -BOOL name_convert(char *OutName,char *InName,BOOL mangle, char *MangledNames);
- +BOOL name_convert(char *OutName,char *InName,BOOL need83,int snum);
- struct hostent *Get_Hostbyname(char *name);
- struct passwd *Get_Pwnam(char *user,BOOL allow_change);
- void Abort(void);
- @@ -714,7 +715,6 @@
- BOOL file_exist(char *fname,struct stat *sbuf);
- int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt, long time_out, BOOL exact);
- void close_sockets(void );
- -int write_with_timeout(int fd, char *buf, int length, long time_out);
- BOOL send_smb(char *buffer);
- BOOL send_keepalive(int client);
- int read_data(int fd,char *buffer,int N);
- @@ -793,7 +793,7 @@
- int interpret_short_filename(char *p,file_info *finfo);
- int interpret_long_filename(int level,char *p,file_info *finfo);
- unsigned long interpret_addr(char *str);
- -void mangle_name_83(char *s, char *MangledMap);
- +void mangle_name_83(char *s);
- BOOL lp_casesignames(void);
- #if AJT
- void ajt_panic(void);
- diff -u -r --new-file last-version/source/sockspy.c samba-1.9.14alpha15/source/sockspy.c
- --- last-version/source/sockspy.c Sat Apr 15 20:30:24 1995
- +++ samba-1.9.14alpha15/source/sockspy.c Tue Sep 12 15:30:53 1995
- @@ -148,6 +148,7 @@
- SelectReadMask = ReadMask;
-
- /* Wait for data to be present to be moved */
- + errno = 0;
- nready = select(32,&SelectReadMask,(int *)0,(int *)0,NIL);
- } while( nready < 0 && errno == EINTR );
-
- diff -u -r --new-file last-version/source/system.c samba-1.9.14alpha15/source/system.c
- --- last-version/source/system.c Thu Jan 1 10:00:00 1970
- +++ samba-1.9.14alpha15/source/system.c Tue Sep 12 16:14:57 1995
- @@ -0,0 +1,102 @@
- +/*
- + Unix SMB/Netbios implementation.
- + Version 1.9.
- + Samba system utilities
- + Copyright (C) Andrew Tridgell 1992-1995
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (at your option) any later version.
- +
- + This program is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + GNU General Public License for more details.
- +
- + You should have received a copy of the GNU General Public License
- + along with this program; if not, write to the Free Software
- + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- +*/
- +
- +#include "includes.h"
- +
- +/*
- + The idea is that this file will eventually have wrappers around all
- + important system calls in samba. The aim is twofold:
- +
- + - to enable easier porting by putting OS dependent stuff in here
- +
- + - to allow for hooks into other "pseudo-filesystems"
- +*/
- +
- +
- +/*******************************************************************
- +this replaces the normal select() system call
- +return if some data has arrived on one of the file descriptors
- +return -1 means error
- +********************************************************************/
- +#ifdef NO_SELECT
- +static int pollfd(int fd)
- +{
- + int r=0;
- +
- +#ifdef HAS_RDCHK
- + r = rdchk(fd);
- +#endif
- +
- +#ifdef HAS_TCRDCHK
- + (void)ioctl(fd, TCRDCHK, &r);
- +#endif
- +
- +#ifdef HAS_FIONREAD
- + (void)ioctl(fd, FIONREAD, &r);
- +#endif
- +
- + return(r);
- +}
- +
- +int sys_select(fd_set *fds,struct timeval *tval)
- +{
- + fd_set fds2;
- + int counter=0;
- + int found=0;
- +
- + FD_ZERO(&fds2);
- +
- + while (1)
- + {
- + int i;
- + for (i=0;i<255;i++) {
- + if (FD_ISSET(i,fds) && pollfd(i)>0) {
- + found++;
- + FD_SET(i,&fds2);
- + }
- + }
- +
- + if (found) {
- + memcpy((void *)fds,(void *)&fds2,sizeof(fds2));
- + return(found);
- + }
- +
- + if (tval && tval.tv_sec < counter) return(0);
- + sleep(1);
- + counter++;
- + }
- +}
- +
- +#else
- +int sys_select(fd_set *fds,struct timeval *tval)
- +{
- + struct timeval t2;
- + int selrtn;
- +
- + do {
- + if (tval) memcpy((void *)&t2,(void *)tval,sizeof(t2));
- + errno = 0;
- + selrtn = select(255,SELECT_CAST fds,NULL,NULL,tval?&t2:NULL);
- + } while (selrtn<0 && errno == EINTR);
- +
- + return(selrtn);
- +}
- +#endif
- diff -u -r --new-file last-version/source/trans2.c samba-1.9.14alpha15/source/trans2.c
- --- last-version/source/trans2.c Sat Sep 2 17:31:55 1995
- +++ samba-1.9.14alpha15/source/trans2.c Tue Sep 12 21:27:13 1995
- @@ -350,6 +350,7 @@
-
- #ifdef MANGLE_LONG_FILENAMES
- {
- + fstring fname2;
- BOOL illegal = False;
- int i;
- int l = strlen(fname);
- @@ -358,11 +359,8 @@
- illegal = True;
- break;
- }
- - if (illegal) {
- - fstring fname2;
- - name_convert(fname2,fname,True,NULL);
- - strcpy(fname,fname2);
- - }
- + name_convert(fname2,fname,illegal,SNUM(cnum));
- + strcpy(fname,fname2);
- }
- #endif
-
- @@ -449,7 +447,7 @@
- SIVAL(p,0,mode); p += 4;
- SIVAL(p,0,strlen(fname)); p += 4;
- SIVAL(p,0,0); p += 4;
- - name_convert(p+2,fname,True,NULL);
- + name_convert(p+2,fname,True,SNUM(cnum));
- strupper(p+2);
- SSVAL(p,0,strlen(p+2));
- p += 2 + 24;
- diff -u -r --new-file last-version/source/util.c samba-1.9.14alpha15/source/util.c
- --- last-version/source/util.c Tue Sep 12 01:59:23 1995
- +++ samba-1.9.14alpha15/source/util.c Tue Sep 12 21:02:39 1995
- @@ -74,6 +74,7 @@
- client can link easily */
- BOOL case_sensitive;
- BOOL case_preserve;
- +BOOL use_mangled_map = False;
- BOOL short_case_preserve;
- BOOL case_mangle;
-
- @@ -1968,13 +1969,7 @@
- FD_ZERO(&fds);
- FD_SET(fd,&fds);
-
- - do {
- - struct timeval t2;
- - memcpy((void *)&t2,(void *)&timeout,sizeof(t2));
- - errno = 0;
- - selrtn = select(255,SELECT_CAST &fds,NULL,NULL,&t2);
- - }
- - while( selrtn < 0 && errno == EINTR );
- + selrtn = sys_select(&fds,&timeout);
-
- /* Check if error */
- if(selrtn == -1)
- @@ -2047,15 +2042,7 @@
- timeout.tv_sec = maxtime / 1000;
- timeout.tv_usec = (maxtime % 1000) * 1000;
-
- - do {
- - errno = 0;
- - if (maxtime > 0)
- - selrtn = select(255,SELECT_CAST &fds,NULL,NULL,&timeout);
- - else
- - selrtn = select(255,SELECT_CAST &fds,NULL,NULL,NULL);
- - }
- - while( selrtn < 0 && errno == EINTR );
- -
- + selrtn = sys_select(&fds,maxtime>0?&timeout:NULL);
-
- if (!FD_ISSET(fd,&fds))
- return 0;
- @@ -2077,103 +2064,6 @@
- }
-
- /****************************************************************************
- -write data to a device with a timout in msec.
- -****************************************************************************/
- -int write_with_timeout(int fd, char *buf, int length, long time_out)
- -{
- - fd_set fds;
- - int selrtn;
- - int nwritten = 0;
- - int writeret;
- - struct timeval timeout, tval1, tval2, tvaldiff;
- -
- - if(time_out == -2)
- - time_out = DEFAULT_PIPE_TIMEOUT;
- -
- - /* Blocking write */
- - if(time_out == -1) {
- - return write_data(fd, buf, length);
- - }
- -
- - /* Non blocking write */
- - if(time_out == 0) {
- - set_blocking(fd, False);
- - nwritten = write(fd, buf, length);
- - if( nwritten == -1 && errno == EWOULDBLOCK)
- - nwritten = 0;
- - set_blocking(fd,True);
- - return nwritten;
- - }
- -
- - /* Most difficult - timeout write */
- -
- - /* Set initial timeout */
- - timeout.tv_sec = time_out / 1000;
- - timeout.tv_usec = 1000*(time_out % 1000);
- -
- - /* As most UNIXes don't modify the value of timeout
- - when they return from select we need to get the timeofday (in usec)
- - now, and also after the select returns so we know
- - how much time has elapsed */
- -
- - GetTimeOfDay( &tval1);
- - nwritten = 0; /* Number of bytes we have written */
- -
- - for(;;) {
- -
- - FD_ZERO(&fds);
- - FD_SET(fd,&fds);
- -
- - /* Wait with timeout until we can write */
- - do {
- - struct timeval t2;
- - memcpy((void *)&t2,(void *)&timeout,sizeof(t2));
- - errno = 0;
- - selrtn = select(255,NULL,SELECT_CAST &fds,NULL,&t2);
- - }
- - while( selrtn < 0 && errno == EINTR );
- -
- - /* Check if error */
- - if(selrtn == -1)
- - return -1;
- -
- - /* Did we timeout ? */
- - if (selrtn == 0 )
- - break; /* Yes */
- -
- - /* Set the fd nonblocking and write as much as we can */
- - set_blocking(fd, False);
- - writeret = write( fd, buf+nwritten, length-nwritten );
- - set_blocking(fd,True);
- - if(writeret == -1)
- - return -1;
- - nwritten += writeret;
- -
- - /* If we have written more than length then return */
- - if( nwritten >= length )
- - break;
- -
- - /* We need to do another select - but first reduce the
- - time_out by the amount of time already elapsed - if
- - this is less than zero then return */
- - GetTimeOfDay( &tval2);
- - (void)tval_sub( &tvaldiff, &tval2, &tval1);
- -
- - if( tval_sub( &timeout, &timeout, &tvaldiff) <= 0) {
- - /* We timed out */
- - break;
- - }
- -
- - /* Save the time of day as we need to do the
- - select again (saves a system call)*/
- - tval1 = tval2;
- - }
- - /* Return the number we got */
- - return(nwritten);
- -}
- -
- -
- -/****************************************************************************
- send a keepalive packet (rfc1002)
- ****************************************************************************/
- BOOL send_keepalive(int client)
- @@ -2651,7 +2541,7 @@
-
- FD_ZERO(&fds);
- errno = 0;
- - select(255,NULL,SELECT_CAST &fds,NULL,&tval);
- + sys_select(&fds,&tval);
-
- GetTimeOfDay(&t2);
- tdiff = TvalDiff(&t1,&t2);
- @@ -2842,11 +2732,13 @@
- StrnCpy(p1,regexp,sizeof(pstring)-1);
- StrnCpy(p2,str,sizeof(pstring)-1);
-
- +#if 0
- if (strchr(p1,'.'))
- {
- string_sub(p1,"*.*","*");
- string_sub(p1,".*","*");
- }
- +#endif
-
- /* Remove any *? and ** as they are meaningless */
- for(p = p1; *p; p++)
- @@ -4206,6 +4098,65 @@
- return NULL;
- }
- #endif /* REPLACE_STRSTR */
- +
- +
- +#ifdef REPLACE_MKTIME
- +/*******************************************************************
- +a mktime() replacement for those who don't have it - contributed by
- +C.A. Lademann <cal@zls.com>
- +********************************************************************/
- +#define MINUTE 60
- +#define HOUR 60*MINUTE
- +#define DAY 24*HOUR
- +#define YEAR 365*DAY
- +time_t Mktime(struct tm *t)
- +{
- + struct tm *u;
- + time_t epoch = 0;
- + int mon [] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
- + y, m, i;
- +
- + if(t->tm_year < 70)
- + return((time_t)-1);
- +
- + epoch = (t->tm_year - 70) * YEAR +
- + (t->tm_year / 4 - 70 / 4 - t->tm_year / 100) * DAY;
- +
- + y = t->tm_year;
- + m = 0;
- +
- + for(i = 0; i < t->tm_mon; i++) {
- + epoch += mon [m] * DAY;
- + if(m == 1 && y % 4 == 0 && (y % 100 != 0 || y % 400 == 0))
- + epoch += DAY;
- +
- + if(++m > 11) {
- + m = 0;
- + y++;
- + }
- + }
- +
- + epoch += (t->tm_mday - 1) * DAY;
- + epoch += t->tm_hour * HOUR + t->tm_min * MINUTE + t->tm_sec;
- +
- + if((u = localtime(&epoch)) != NULL) {
- + t->tm_sec = u->tm_sec;
- + t->tm_min = u->tm_min;
- + t->tm_hour = u->tm_hour;
- + t->tm_mday = u->tm_mday;
- + t->tm_mon = u->tm_mon;
- + t->tm_year = u->tm_year;
- + t->tm_wday = u->tm_wday;
- + t->tm_yday = u->tm_yday;
- + t->tm_isdst = u->tm_isdst;
- +#ifndef NO_TM_NAME
- + memcpy(t->tm_name, u->tm_name, LTZNMAX);
- +#endif
- + }
- +
- + return(epoch);
- +}
- +#endif /* REPLACE_MKTIME */
-
-
-
- diff -u -r --new-file last-version/source/version.h samba-1.9.14alpha15/source/version.h
- --- last-version/source/version.h Tue Sep 12 02:05:19 1995
- +++ samba-1.9.14alpha15/source/version.h Tue Sep 12 23:01:25 1995
- @@ -1 +1 @@
- -#define VERSION "1.9.14alpha14"
- +#define VERSION "1.9.14alpha15"
- diff -u -r --new-file last-version/source/vt_mode.c samba-1.9.14alpha15/source/vt_mode.c
- --- last-version/source/vt_mode.c Thu Jan 1 10:00:00 1970
- +++ samba-1.9.14alpha15/source/vt_mode.c Tue Sep 12 16:28:49 1995
- @@ -0,0 +1,495 @@
- +/* vt_mode.c */
- +/*
- +support vtp-sessions
- +
- +written by Christian A. Lademann <cal@zls.com>
- +*/
- +
- +/*
- +02.05.95:cal:ported to samba-1.9.13
- +*/
- +
- +#define __vt_mode_c__
- +
- +
- +/* #include <stdio.h> */
- +/* #include <fcntl.h> */
- +/* #include <sys/types.h> */
- +/* #include <unistd.h> */
- +/* #include <signal.h> */
- +/* #include <errno.h> */
- +/* #include <ctype.h> */
- +/* #include <utmp.h> */
- +/* #include <sys/param.h> */
- +/* #include <sys/ioctl.h> */
- +/* #include <stdlib.h> */
- +/* #include <string.h> */
- +
- +#include "includes.h"
- +#include "vt_mode.h"
- +#include <utmp.h>
- +
- +#ifdef SCO
- + extern char *strdup();
- +#endif
- +
- +
- +#ifdef LINUX
- +# define HAS_VTY
- +#endif
- +
- +#ifdef SCO
- +# define HAS_PTY
- +# define HAS_VTY
- +
- +# include <sys/tty.h>
- +#endif
- +
- +extern int DEBUGLEVEL;
- +extern char *InBuffer, *OutBuffer;
- +extern int done_become_user;
- +
- +char master_name [64], slave_name [64];
- +int master, slave, i, o, e;
- +
- +int ms_type = MS_NONE,
- + ms_poll = 0;
- +
- +
- +/*
- +VT_Check: test incoming packet for "vtp" or "iVT1\0"
- +*/
- +int VT_Check(buffer)
- +char *buffer;
- +{
- + DEBUG(3,("Checking packet: <%10s...>\n", buffer+4));
- + if((strncmp(buffer+4, "vtp", 3) == 0 && smb_len(buffer) == 3) || (strncmp(buffer+4, "iVT1\0", 5) == 0 && smb_len(buffer) == 5))
- + return(1);
- + else
- + return(0);
- +}
- +
- +
- +/*
- +VT_Start_utmp: prepare /etc/utmp for /bin/login
- +*/
- +VT_Start_utmp()
- +{
- + struct utmp u, *v;
- + char *tt;
- +
- +
- + setutent();
- +
- + strcpy(u.ut_line, VT_Line);
- +
- + if((v = getutline(&u)) == NULL) {
- + if(strncmp(VT_Line, "tty", 3) == 0)
- + tt = VT_Line + 3;
- + else if(strlen(VT_Line) > 4)
- + tt = VT_Line + strlen(VT_Line) - 4;
- + else
- + tt = VT_Line;
- +
- + strcpy(u.ut_id, tt);
- + u.ut_time = time((time_t*)0);
- + }
- +
- + strcpy(u.ut_user, "LOGIN");
- + strcpy(u.ut_line, VT_Line);
- + u.ut_pid = getpid();
- + u.ut_type = LOGIN_PROCESS;
- + pututline(&u);
- +
- + endutent();
- +
- + return(0);
- +}
- +
- +
- +/*
- +VT_Stop_utmp: prepare /etc/utmp for other processes
- +*/
- +VT_Stop_utmp()
- +{
- + struct utmp u, *v;
- +
- +
- + if(VT_Line != NULL) {
- + setutent();
- +
- + strcpy(u.ut_line, VT_Line);
- +
- + if((v = getutline(&u)) != NULL) {
- + strcpy(v->ut_user, "");
- + v->ut_type = DEAD_PROCESS;
- + v->ut_time = time((time_t*)0);
- + pututline(v);
- + }
- +
- + endutent();
- + }
- +
- + return(0);
- +}
- +
- +
- +/*
- +VT_AtExit: Things to do when the program exits
- +*/
- +void VT_AtExit()
- +{
- + if(VT_ChildPID > 0) {
- + kill(VT_ChildPID, SIGHUP);
- + (void)wait(NULL);
- + }
- +
- + VT_Stop_utmp();
- +}
- +
- +
- +/*
- +VT_SigCLD: signalhandler for SIGCLD: set flag if child-process died
- +*/
- +void VT_SigCLD(sig)
- +int sig;
- +{
- + if(wait(NULL) == VT_ChildPID)
- + VT_ChildDied = True;
- + else
- + signal(SIGCLD, VT_SigCLD);
- +}
- +
- +
- +/*
- +VT_SigEXIT: signalhandler for signals that cause the process to exit
- +*/
- +void VT_SigEXIT(sig)
- +int sig;
- +{
- + VT_AtExit();
- +
- + exit(1);
- +}
- +
- +
- +/*
- +VT_Start: initialize vt-specific data, alloc pty, spawn shell and send ACK
- +*/
- +int VT_Start()
- +{
- + char OutBuf [64], *X, *Y;
- +
- +
- + ms_type = MS_NONE;
- + master = slave = -1;
- +
- +#ifdef HAS_VTY
- +#ifdef LINUX
- +# define MASTER_TMPL "/dev/pty "
- +# define SLAVE_TMPL "/dev/tty "
- +# define LETTER1 "pqrs"
- +# define POS1 8
- +# define LETTER2 "0123456789abcdef"
- +# define POS2 9
- +#endif
- +
- +#ifdef SCO
- +# define MASTER_TMPL "/dev/ptyp_ "
- +# define SLAVE_TMPL "/dev/ttyp_ "
- +# define LETTER1 "0123456"
- +# define POS1 10
- +# define LETTER2 "0123456789abcdef"
- +# define POS2 11
- +#endif
- +
- + if(ms_poll == MS_VTY || ms_poll == 0) {
- + strcpy(master_name, MASTER_TMPL);
- + strcpy(slave_name, SLAVE_TMPL);
- +
- + for(X = LETTER1; *X && master < 0; X++)
- + for(Y = LETTER2; *Y && master < 0; Y++) {
- + master_name [POS1] = *X;
- + master_name [POS2] = *Y;
- + if((master = open(master_name, O_RDWR)) >= 0) {
- + slave_name [POS1] = *X;
- + slave_name [POS2] = *Y;
- + if((slave = open(slave_name, O_RDWR)) < 0)
- + close(master);
- + }
- + }
- +
- + if(master >= 0 && slave >= 0)
- + ms_type = MS_VTY;
- + }
- +
- +# undef MASTER_TMPL
- +# undef SLAVE_TMPL
- +# undef LETTER1
- +# undef LETTER2
- +# undef POS1
- +# undef POS2
- +#endif
- +
- +
- +#ifdef HAS_PTY
- +#ifdef SCO
- +# define MASTER_TMPL "/dev/ptyp%d"
- +# define SLAVE_TMPL "/dev/ttyp%d"
- +# define MIN_I 0
- +# define MAX_I 63
- +#endif
- +
- + if(ms_poll == MS_PTY || ms_poll == 0) {
- + int i;
- +
- + for(i = MIN_I; i <= MAX_I && master < 0; i++) {
- + sprintf(master_name, MASTER_TMPL, i);
- + if((master = open(master_name, O_RDWR)) >= 0) {
- + sprintf(slave_name, SLAVE_TMPL, i);
- + if((slave = open(slave_name, O_RDWR)) < 0)
- + close(master);
- + }
- + }
- +
- + if(master >= 0 && slave >= 0)
- + ms_type = MS_PTY;
- + }
- +
- +# undef MASTER_TMPL
- +# undef SLAVE_TMPL
- +# undef MIN_I
- +# undef MAX_I
- +#endif
- +
- +
- + if(! ms_type)
- + return(-1);
- +
- + VT_Line = strdup(strrchr(slave_name, '/') + 1);
- +
- + switch((VT_ChildPID = fork())) {
- + case -1:
- + return(-1);
- + break;
- +
- + case 0:
- +#ifdef SCO
- + setsid();
- +#endif
- + close(0);
- + close(1);
- + close(2);
- +
- + i = open(slave_name, O_RDWR);
- + o = open(slave_name, O_RDWR);
- + e = open(slave_name, O_RDWR);
- +
- +#ifdef LINUX
- + setsid();
- + if (ioctl(slave, TIOCSCTTY, (char *)NULL) == -1)
- + exit(1);
- +#endif
- +#ifdef SCO
- + tcsetpgrp(0, getpid());
- +#endif
- +
- + VT_Start_utmp();
- +
- + system("stty sane");
- + execlp("/bin/login", "login", "-c", (char*)0);
- + exit(1);
- + break;
- +
- + default:
- + VT_Mode = True;
- + VT_Status = VT_OPEN;
- + VT_ChildDied = False;
- + VT_Fd = master;
- +
- + signal(SIGCLD, VT_SigCLD);
- +
- + signal(SIGHUP, VT_SigEXIT);
- + signal(SIGTERM, VT_SigEXIT);
- + signal(SIGINT, VT_SigEXIT);
- + signal(SIGQUIT, VT_SigEXIT);
- +
- + memset(OutBuf, 0, sizeof(OutBuf));
- + OutBuf [4] = 0x06;
- + _smb_setlen(OutBuf, 1);
- +
- + send_smb(OutBuf);
- +
- + return(0);
- + break;
- + }
- +}
- +
- +
- +/*
- +VT_Output: transport data from socket to pty
- +*/
- +int VT_Output(Buffer)
- +char *Buffer;
- +{
- + int i, len, nb;
- +
- +
- + if(VT_Status != VT_OPEN)
- + return(-1);
- +
- + len = smb_len(Buffer);
- +
- + nb = write(VT_Fd, Buffer + 4, len);
- +
- + return((nb == len) ? 0 : -1);
- +}
- +
- +
- +/*
- +VT_Input: transport data from pty to socket
- +*/
- +int VT_Input(Buffer, Size)
- +char *Buffer;
- +int Size;
- +{
- + int len;
- +
- +
- + if(VT_Status != VT_OPEN)
- + return(-1);
- +
- + memset(Buffer, 0, Size);
- + len = read(VT_Fd, Buffer + 4, MIN(VT_MAXREAD, Size));
- +
- + _smb_setlen(Buffer, len);
- +
- + return(len + 4);
- +}
- +
- +
- +/*
- +VT_Process: main loop while in vt-mode
- +*/
- +void VT_Process()
- +{
- + static int trans_num = 0;
- + extern int Client;
- + int nread;
- +
- +
- + VT_Start();
- +
- + atexit(VT_AtExit);
- +
- + while (True) {
- + int32 len;
- + int msg_type;
- + int msg_flags;
- + int counter;
- + int last_keepalive=0;
- + struct fd_set si;
- + struct timeval to, *top;
- + int n, ret, t;
- +
- +
- + errno = 0;
- + t = SMBD_SELECT_LOOP*1000;
- +
- +
- + FD_ZERO(&si);
- + FD_SET(Client, &si);
- +
- + FD_SET(VT_Fd, &si);
- +
- + if(t >= 0) {
- + to.tv_sec = t / 1000;
- + to.tv_usec = t - (to.tv_sec * 1000);
- +
- + top = &to;
- + } else
- + top = NULL;
- +
- + if(VT_ChildDied)
- + goto leave_VT_Process;
- +
- + n = select(MAX(VT_Fd, Client) + 1, &si, NULL, NULL, top);
- +
- + if(VT_ChildDied)
- + goto leave_VT_Process;
- +
- + if(n == 0) {
- + int i;
- + time_t t;
- + BOOL allidle = True;
- + extern int keepalive;
- +
- + counter += SMBD_SELECT_LOOP;
- +
- + t = time(NULL);
- +
- + if (keepalive && (counter-last_keepalive)>keepalive) {
- + if (!send_keepalive(Client))
- + goto leave_VT_Process;
- + last_keepalive = counter;
- + }
- + } else if(n > 0) {
- + counter = 0;
- +
- + if(FD_ISSET(VT_Fd, &si)) {
- + /* got input from vt */
- + nread = VT_Input(OutBuffer, MIN(BUFFER_SIZE,lp_maxxmit()));
- +
- + if(nread > 0)
- + send_smb(OutBuffer);
- + }
- +
- + if(FD_ISSET(Client, &si)) {
- + /* got input from socket */
- +
- + if(receive_smb(InBuffer, 0)) {
- + msg_type = CVAL(InBuffer,0);
- + msg_flags = CVAL(InBuffer,1);
- +
- + len = smb_len(InBuffer);
- +
- + DEBUG(6,("got message type 0x%x of len 0x%x\n",msg_type,len));
- +
- + nread = len + 4;
- +
- + DEBUG(3,("%s Transaction %d of length %d\n",timestring(),trans_num,nread));
- +
- + if(msg_type == 0)
- + VT_Output(InBuffer);
- + else {
- + nread = construct_reply(InBuffer,OutBuffer,nread,MIN(BUFFER_SIZE,lp_maxxmit()));
- +
- + if(nread > 0) {
- + if (nread != smb_len(OutBuffer) + 4) {
- + DEBUG(0,("ERROR: Invalid message response size! %d %d\n",
- + nread,
- + smb_len(OutBuffer)));
- + } else
- + send_smb(OutBuffer);
- + }
- + }
- + } else
- + if(errno == EBADF)
- + goto leave_VT_Process;
- + }
- + }
- +
- + trans_num++;
- + }
- +
- + leave_VT_Process:
- +/*
- + if(VT_ChildPID > 0)
- + kill(VT_ChildPID, SIGHUP);
- +
- + VT_Stop_utmp(VT_Line);
- + return;
- +*/
- + close_sockets();
- + exit(0);
- +}
- diff -u -r --new-file last-version/source/vt_mode.h samba-1.9.14alpha15/source/vt_mode.h
- --- last-version/source/vt_mode.h Thu Jan 1 10:00:00 1970
- +++ samba-1.9.14alpha15/source/vt_mode.h Tue Sep 12 16:29:04 1995
- @@ -0,0 +1,48 @@
- +/* vt_mode.h */
- +/*
- +support vtp-sessions
- +
- +written by Christian A. Lademann <cal@zls.com>
- +*/
- +
- +/*
- +02.05.95:cal:ported to samba-1.9.13
- +*/
- +
- +#ifndef __vt_mode_h__
- +# define __vt_mode_h__
- +
- +# define VT_CLOSED 0
- +# define VT_OPEN 1
- +
- +# define MS_NONE 0
- +# define MS_PTY 1
- +# define MS_STREAM 2
- +# define MS_VTY 3
- +
- +# define VT_MAXREAD 32
- +
- +
- +# undef EXTERN
- +
- +# ifndef __vt_mode_c__
- +# define EXTERN extern
- +# define DEFAULT(v)
- +# else
- +# define EXTERN
- +# define DEFAULT(v) =(v)
- +# endif
- +
- + EXTERN int VT_Status DEFAULT(VT_CLOSED),
- + VT_Fd DEFAULT(-1),
- + VT_ChildPID DEFAULT(-1);
- +
- + EXTERN BOOL VT_Mode DEFAULT(False),
- + VT_ChildDied DEFAULT(False);
- +
- + EXTERN char *VT_Line DEFAULT(NULL);
- +
- +# undef EXTERN
- +
- +
- +#endif /* __vt_mode_h__ */
-